<template>
  <ul>
    <li v-for="(item, index) in filterArr" :key="index">{{ item }}</li>
  </ul>

  <button @click="pushArr">点击添加数组项</button>
</template>

<script setup>
//1.导入computed api
import { ref, computed } from 'vue'

const arr = ref([80, 100, 90, 70, 6])

const filterArr = computed(() => arr.value.filter(item => item >= 90))

console.log(filterArr)

const pushArr = () => {
  arr.value.push(100)
}
</script>

<style lang="less"></style>
